{extend name="layout/layout" /}
{block name="pagecss"}
<style>
	.zhushi a{
		margin-left: 15px;
	}
</style>
{/block}
{block name="content"}
<div class="row">
	<div class="col-lg-12">
		<div class="box box-success">
			<div class="box-header with-border">
				<h3 class="box-title">设置订单商品的配送方式和运费，并根据买家增加商品而追加运费</h3>
				<div class="box-tools pull-right">

				</div>
			</div>
			{if condition="$is_tdt == 1"}
			<div class="box-body">
				<div class="box-content col-md-9  table-bordered table" style="padding: 25px">
					<div style="float: left;">
						<img class="margin-right" src="__STATIC__/admin/img/u5338.png">
					</div>
					<div style="margin-left: 100px;">
						<div style="float: right">
							{if condition="($self_type_status == 1)"}
							<a  class="btn btn-olive change_btn change_btn bg-olive" style="margin-top: 13px" href="{:url('admin/TenantDistributionType/shop_extraction',['type_id'=>$self_type_id])}">
								已开启
							</a>
							{else /}
							<a class="btn btn-warning change_btn" style="margin-top: 13px" href="{:url('admin/TenantDistributionType/shop_extraction',['type_id'=>$self_type_id])}">
								未开启
							</a>
							{/if}
						</div>
						<div style="margin-right: 100px">
							<p style="font-size: 18px">到店自取</p>
							<p>用户可以到指定门店自行取货</p>
						</div>
					</div>
				</div>
				<div class="box-content col-md-9  table-bordered table" style="padding: 25px">
					<div style="float: left;">
						<img class="margin-right" src="__STATIC__/admin/img/u5339.png">
					</div>
					<div style="margin-left: 100px;">
						<div style="float: right">
							{if condition="($logistics_type_status == 1)"}
							<a class="btn btn-olive change_btn change_btn bg-olive" style="margin-top: 13px" href="{:url('admin/logistics/index',array('logistics_type_id'=>$logistics_type_id))}">
								已开启
							</a>
							{else /}
							<a class="btn btn-warning change_btn" style="margin-top: 13px" href="{:url('admin/logistics/index',array('logistics_type_id'=>$logistics_type_id))}">
								未开启
							</a>
							{/if}
						</div>
						<div style="margin-right: 100px">
							<p style="font-size: 18px">物流配送</p>
							<p>由第三方快递公司或商家完成商品配送服务</p>
						</div>
					</div>
				</div>

			</div>
			{else /}
			<div class="box-body">
				<div class="box-content col-md-9  table-bordered table" style="padding: 25px">
					<div style="float: left;">
						<img class="margin-right" src="__STATIC__/admin/img/u5339.png">
					</div>
					<div style="margin-left: 100px;">
						<div style="float: right">

							<a class="btn btn-warning change_btn" id="chushihua" style="margin-top: 13px">
								初始化物流系统
							</a>

						</div>
						<div style="margin-right: 100px">
							<p style="font-size: 18px">初始化物流</p>
							<p>您的系统还没有初始化物流</p>
						</div>
					</div>
				</div>


			</div>
			{/if}

		</div>
	</div>
</div>
{/block}

{block name="pagescript"}
<script>
    $(document).ready(function() {
		$('#chushihua').click(function() {
            layer.open({
                type: 1
                ,title: "提示" //不显示标题栏   title : false/标题
                ,closeBtn: true
                ,area: '300px;'
                ,shade: 0.8
                ,id: 'LAY_layuipro' //设定一个id，防止重复弹出
                ,resize: false
                ,btn: ['确定', '取消']
                ,btnAlign: 'c'
                ,moveType: 1 //拖拽模式，0或者1
                ,content: '<div style="padding: 50px; line-height: 22px; background-color: #393D49; color: #fff; font-weight: 300;"><span style="font-weight: bold">初始化配送系统</span><br/>初始化订单的配送方式，未设置订单无法配送！</div>'
                ,success: function(layero){
                    var btn = layero.find('.layui-layer-btn');
                    btn.find('.layui-layer-btn0').click(function(){

                        var url = "/admin/TenantDistributionType/ajax_setting";
                        $.ajax({
                            type: 'POST',
                            url: url,
                            dataType: 'json',
                            success: function(data){

                                layer.alert(data.message,{icon: 6});
                                location.reload();
                            },
                            error:function(data) {
                                console.log(data.msg);
                            },
                        });
                    });
                }
            });
        });

    })
</script>
{/block}
